<?php
namespace Admin\Controller;
use Think\Controller;
class BackController extends Controller
{
    /*1.反馈列表*/
    
    public function backlist(){
        $backModel=M('back');//表明,conb中定义前缀
        //var_damn($adminModel);
       // $admin=$adminModel->order('admin_id asc')->select(); //desc降序 asc升序

        $back=$backModel->table('back b,users u')->where('b.user_id=u.user_id')->field('b.*,u.*')->select();
         //调用视图层显示数据
        $this->back=$back;
            
        $this->display();
    }

/*2.查看反馈详情*/

public function detailback($back_id){
        $backmodel=M('back');
     $back=$backmodel->table('back b,users u')->where("b.back_id=$back_id and b.user_id=u.user_id")->field('b.*,u.*')->select(); 
        $this->back=$back;
       $this->display();
    } 

   /*3.删除反馈*/
public function delback($back_id){
   
    $backModel = M("back"); // 实例化User对象
    $back=$backModel->where("back_id=$back_id")->select();
    $result=$backModel->where("back_id=$back_id")->delete(); // 删除id为5的用户数据
    
        if($result){                    
            $this->success('删除成功');//设置成功后跳转页面的地址，默认的返回页面是$_SERVER['HTTP_REFERER']
            } else {
             $this->error('删除失败'); //错误页面的默认跳转页面是返回前一页，通常不需要设置
            }

    }

}